import request from '@/utils/request'
import type { IResponseBody } from './userApi'

export interface IClass {
  id: number
  nickname: string
}

export function getClassAll(): Promise<IResponseBody<IClass[]>> {
  return request.get('/class')
}

export function addClass(nickname: string): Promise<IResponseBody<IClass[]>> {
  return request.post('/class', {
    nickname
  })
}
